package com.westos.userauth.dao.impl;

import com.westos.userauth.dao.PartyDao;
import com.westos.userauth.dao.PartyGroupDao;
import com.westos.userauth.dao.mybatis.PartyAttributeDAO;
import com.westos.userauth.dao.mybatis.PartyDAO;
import com.westos.userauth.dao.mybatis.PartyGroupDAO;
import com.westos.userauth.domain.Party;
import com.westos.userauth.domain.PartyAttribute;
import com.westos.userauth.domain.PartyGroup;
import com.westos.userauth.domain.Person;
import com.westos.userauth.dto.PartySearchDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * @Description
 * @Date 2020/11/15 13:46
 * @Created by 张佳妮
 */

@Service
public class MybatisPartyGroupDao implements PartyGroupDao {

    @Autowired
    private PartyGroupDAO partyGroupDAO;

    @Override
    public int deletePartyGroupByPartyId(String partyId) {
        return partyGroupDAO.deletePartyGroupByPartyId(partyId);
    }

    @Override
    public int insertPartyGroup(PartyGroup partyGroup) {
        return partyGroupDAO.insertPartyGroup(partyGroup);
    }

    @Override
    public int updatePartyGroup(PartyGroup partyGroup) {
        return partyGroupDAO.updatePartyGroup(partyGroup);
    }

    @Override
    public int updatePartyGroupByName(PartyGroup partyGroup, String newName) {
        return partyGroupDAO.updatePartyGroupByName(partyGroup,newName);
    }

    @Override
    public List<PartyGroup> selectPartyGroup(PartySearchDto partySearchDto) {
        return partyGroupDAO.selectPartyGroup(null);
    }

    @Override
    public PartyGroup selectPartyGroupById(String partyId) {
        return partyGroupDAO.selectPartyGroupById(partyId);
    }
}
